import request from '@/utils/request'

// 获取底图列表
export function mapQuery(params) {
  return request({
    method: 'get',
    url: '/resource/mapbase/query',
    params
  })
}

// 新增底图
export function mapInsert(data) {
  return request({
    method: 'post',
    url: '/resource/mapbase/add',
    data: data
  })
}

// 修改底图
export function mapUpdate(data, pkid) {
  return request({
    method: 'put',
    url: `/resource/mapbase/update/${pkid}`,
    data: data
  })
}

// 删除底图
export function mapDelete(pkid) {
  return request({
    method: 'delete',
    url: `/resource/mapbase/delete?pkid=${pkid}`
  })
}

//  上传缩略图
export function uploadImage(data) {
  return request({
    method: 'post',
    url: '/resource/mapBase/upload',
    data
  })
}

// 新增历史影像
export function mapServiceAdd(data) {
  return request({
    method: 'post',
    url: '/resource/mapbase/service/add',
    data: data
  })
}

// 删除历史影像
export function mapServiceDelete(pkid) {
  return request({
    method: 'delete',
    url: `/resource/mapbase/service/delete?pkid=${pkid}`
  })
}

// 修改历史影像
export function mapServiceUpdate(data, pkid) {
  return request({
    method: 'put',
    url: `/resource/mapbase/service/update/${pkid}`,
    data: data
  })
}

// 查询底图
export function mapServiceQuery(id) {
  return request({
    method: 'get',
    url: `/resource/mapbase/query/id?pkid=${id}`
  })
}

// 专题默认地图添加
export function mapBaseSpecialAdd(data) {
  return request({
    method: 'post',
    url: '/resource/mapbase/special/add',
    data: data
  })
}

// 专题默认地图删除
export function mapBaseSpecialDelete(pkid, specialType) {
  return request({
    method: 'delete',
    url: `/resource/mapbase/special/delete?mapBaseId=${pkid}&specialType=${specialType}`
  })
}
